/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.androidpublisher.model;

/**
 * Details of a one-time purchase.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Google Play Android Developer API. For a detailed
 * explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class OneTimePurchaseDetails extends com.google.api.client.json.GenericJson {

  /**
   * The offer ID of the one-time purchase offer.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String offerId;

  /**
   * The details of a pre-order purchase. Only set if it is a pre-order purchase. Note that this
   * field will be set even after pre-order is fulfilled.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private PreorderDetails preorderDetails;

  /**
   * ID of the purchase option. This field is set for both purchase options and variant offers. For
   * purchase options, this ID identifies the purchase option itself. For variant offers, this ID
   * refers to the associated purchase option, and in conjunction with offer_id it identifies the
   * variant offer.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String purchaseOptionId;

  /**
   * The number of items purchased (for multi-quantity item purchases).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer quantity;

  /**
   * The details of a rent purchase. Only set if it is a rent purchase.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private RentalDetails rentalDetails;

  /**
   * The offer ID of the one-time purchase offer.
   * @return value or {@code null} for none
   */
  public java.lang.String getOfferId() {
    return offerId;
  }

  /**
   * The offer ID of the one-time purchase offer.
   * @param offerId offerId or {@code null} for none
   */
  public OneTimePurchaseDetails setOfferId(java.lang.String offerId) {
    this.offerId = offerId;
    return this;
  }

  /**
   * The details of a pre-order purchase. Only set if it is a pre-order purchase. Note that this
   * field will be set even after pre-order is fulfilled.
   * @return value or {@code null} for none
   */
  public PreorderDetails getPreorderDetails() {
    return preorderDetails;
  }

  /**
   * The details of a pre-order purchase. Only set if it is a pre-order purchase. Note that this
   * field will be set even after pre-order is fulfilled.
   * @param preorderDetails preorderDetails or {@code null} for none
   */
  public OneTimePurchaseDetails setPreorderDetails(PreorderDetails preorderDetails) {
    this.preorderDetails = preorderDetails;
    return this;
  }

  /**
   * ID of the purchase option. This field is set for both purchase options and variant offers. For
   * purchase options, this ID identifies the purchase option itself. For variant offers, this ID
   * refers to the associated purchase option, and in conjunction with offer_id it identifies the
   * variant offer.
   * @return value or {@code null} for none
   */
  public java.lang.String getPurchaseOptionId() {
    return purchaseOptionId;
  }

  /**
   * ID of the purchase option. This field is set for both purchase options and variant offers. For
   * purchase options, this ID identifies the purchase option itself. For variant offers, this ID
   * refers to the associated purchase option, and in conjunction with offer_id it identifies the
   * variant offer.
   * @param purchaseOptionId purchaseOptionId or {@code null} for none
   */
  public OneTimePurchaseDetails setPurchaseOptionId(java.lang.String purchaseOptionId) {
    this.purchaseOptionId = purchaseOptionId;
    return this;
  }

  /**
   * The number of items purchased (for multi-quantity item purchases).
   * @return value or {@code null} for none
   */
  public java.lang.Integer getQuantity() {
    return quantity;
  }

  /**
   * The number of items purchased (for multi-quantity item purchases).
   * @param quantity quantity or {@code null} for none
   */
  public OneTimePurchaseDetails setQuantity(java.lang.Integer quantity) {
    this.quantity = quantity;
    return this;
  }

  /**
   * The details of a rent purchase. Only set if it is a rent purchase.
   * @return value or {@code null} for none
   */
  public RentalDetails getRentalDetails() {
    return rentalDetails;
  }

  /**
   * The details of a rent purchase. Only set if it is a rent purchase.
   * @param rentalDetails rentalDetails or {@code null} for none
   */
  public OneTimePurchaseDetails setRentalDetails(RentalDetails rentalDetails) {
    this.rentalDetails = rentalDetails;
    return this;
  }

  @Override
  public OneTimePurchaseDetails set(String fieldName, Object value) {
    return (OneTimePurchaseDetails) super.set(fieldName, value);
  }

  @Override
  public OneTimePurchaseDetails clone() {
    return (OneTimePurchaseDetails) super.clone();
  }

}
